export class MemoryCacher<T>
{
    private key:string[ ];  // 存在Memory中的那一个键
    constructor(key:string[])
    {
        this.key = key;
        let preMemory = Memory as any;
        for(const k of key)
        {
            if(!preMemory[k])
            {
                preMemory[k]={};
                preMemory=   preMemory[k];
            }
        }
    }

    get cache():T
    {
        let preMemory = Memory as any;
        for(const k of this.key)
        {
            preMemory = preMemory[k];
        }
        return preMemory
    }
}